package com.molichuxing.framework.utils;

import java.util.Collection;
import java.util.Map;

public class CollectionUtils {

    /**
     * 判断Collection是否不为空
     * @param collection
     * @return
     */
    public static boolean isNotEmpty(Collection collection) {
        return !isEmpty(collection);
    }

    /**
     * 判断Collection是否为空
     * @param collection
     * @return
     */
    public static boolean isEmpty(Collection collection) {
        if (collection == null || collection.size() <= 0) {
            return true;
        }
        return false;
    }

    /**
     * 判断Map是否不为空
     * @param map
     * @return
     */
    public static boolean isNotEmpty(Map map) {
        return !isEmpty(map);
    }

    /**
     * 判断Map是否为空
     * @param map
     * @return
     */
    public static boolean isEmpty(Map map) {
        if (map == null || map.size() <= 0) {
            return true;
        }
        return false;
    }
}
